package com.free.common.vo;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 功能概述:
 * </p>
 * <p>
 * 功能详述:
 * </p>
 */
public class PageResponseVo<T> implements Serializable {

    /*========================================================================*
     *                         Public Fields (公共属性)
     *========================================================================*/

    /*========================================================================*
     *                         Private Fields (私有属性)
     *========================================================================*/
    private static final long serialVersionUID = 164039065781351655L;


    private Class<T> clazz;

    //当前页
    private int pageNum;

    //每页的数量
    private int pageSize;

    //当前页的数量
    private int size;

    //由于startRow和endRow不常用，这里说个具体的用法
    //可以在页面中"显示startRow到endRow 共size条数据"
    //当前页面第一个元素在数据库中的行号
    private int startRow;

    //当前页面最后一个元素在数据库中的行号
    private int endRow;

    //总记录数
    private long total;

    //总页数
    private int pages;

    //结果集
    private List<T> list;

    private int draw;

    private long recordsTotal;

    private long recordsFiltered;

    /*========================================================================*
     *                         Construct Methods (构造方法)
     *========================================================================*/
    public PageResponseVo() {

    }

    public PageResponseVo(Class<T> clazz)
    {
        this.clazz = clazz;
    }

    /*========================================================================*
     *                         Public Methods (公有方法)
     *========================================================================*/

    /**
     * @return the pageNum
     */
    public int getPageNum()
    {
        return pageNum;
    }


    /**
     * @param pageNum the pageNum to set
     */
    public void setPageNum(int pageNum)
    {
        this.pageNum = pageNum;
    }


    /**
     * @return the pageSize
     */
    public int getPageSize()
    {
        return pageSize;
    }


    /**
     * @param pageSize the pageSize to set
     */
    public void setPageSize(int pageSize)
    {
        this.pageSize = pageSize;
    }


    /**
     * @return the size
     */
    public int getSize()
    {
        return size;
    }


    /**
     * @param size the size to set
     */
    public void setSize(int size)
    {
        this.size = size;
    }


    /**
     * @return the startRow
     */
    public int getStartRow()
    {
        return startRow;
    }


    /**
     * @param startRow the startRow to set
     */
    public void setStartRow(int startRow)
    {
        this.startRow = startRow;
    }


    /**
     * @return the endRow
     */
    public int getEndRow()
    {
        return endRow;
    }


    /**
     * @param endRow the endRow to set
     */
    public void setEndRow(int endRow)
    {
        this.endRow = endRow;
    }


    /**
     * @return the total
     */
    public long getTotal()
    {
        return total;
    }


    /**
     * @param total the total to set
     */
    public void setTotal(long total)
    {
        this.total = total;
    }


    /**
     * @return the pages
     */
    public int getPages()
    {
        return pages;
    }


    /**
     * @param pages the pages to set
     */
    public void setPages(int pages)
    {
        this.pages = pages;
    }


    /**
     * @return the list
     */
    public List<T> getList()
    {
        return list;
    }


    /**
     * @param list the list to set
     */
    public void setList(List<T> list)
    {
        this.list = list;
    }


    public Class<T> getTClazz()
    {
        return this.clazz;
    }

    public int getDraw() {
        return draw;
    }

    public void setDraw(int draw) {
        this.draw = draw;
    }

    public long getRecordsTotal() {
        return total;
    }

    public void setRecordsTotal(long recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    public long getRecordsFiltered() {
        return total;
    }

    public void setRecordsFiltered(long recordsFiltered) {
        this.recordsFiltered = recordsFiltered;
    }

    @Override
    public String toString() {
        return "PageResponseVo{" +
                "clazz=" + clazz +
                ", pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                ", size=" + size +
                ", startRow=" + startRow +
                ", endRow=" + endRow +
                ", total=" + total +
                ", pages=" + pages +
                ", list=" + list +
                ", draw=" + draw +
                ", recordsTotal=" + recordsTotal +
                ", recordsFiltered=" + recordsFiltered +
                '}';
    }

    /*========================================================================*
     *                         Private Methods (私有方法)
     *========================================================================*/
}
